/*
 * @Author: shawnXiao
 * @Date: 2020-11-05 15:59:43
 * @LastEditTime: 2021-12-23 16:54:18
 * @LastEditors: Please set LastEditors
 * @Description: In User Settings Edit
 * @FilePath: /vite2-vue3-typescript/src/apis/Home/index.ts
 */
import request from '@/common/utils/request'
import * as model from './model'

import { instanceProps } from '@/common/utils/request'

// 接口域名
const isMock = import.meta.env.MODE === 'development' ? false : false

const domain = isMock ? './api' : `${import.meta.env.VITE_APP_API_URL}`
const prefix = import.meta.env.MODE === 'development' ? '' : '/reportAndMonitor' // 接口前缀
// 接口路径
const basePath = `${domain}${prefix}`

// 获取所有预警图数据
export function findAll(params: any): any {
  return request({
    url: `${basePath}/findAll`,
    method: 'post',
    model: model.findAll,
    params,
  } as instanceProps)
}

// 获取格子信息每日确认 监测数据
export function getGridList(params: any): any {
  return request({
    url: `${basePath}/getGridList`,
    method: 'get',
    model: null,
    params,
  } as instanceProps)
}
// 获取异常体温 监测数据
export function getAbnormalTemperature(params: any): any {
  return request({
    url: `${basePath}/getReport1`,
    method: 'get',
    model: null,
    params,
  } as instanceProps)
}
// 获取异常出行 监测数据

export function getAbnormalTrip(params: any): any {
  return request({
    url: `${basePath}/getReport2`,
    method: 'get',
    model: null,
    params,
  } as instanceProps)
}

// update
export function updateDate(params: any): any {
  return request({
    url: `${basePath}/update`,
    method: 'get',
    model: model.findAll,
    params,
  } as instanceProps)
}
